package model

import "github.com/jinzhu/gorm"

/**
购物车
 */
type Shopping struct {
	gorm.Model
	goods      []*ShoppingGoods `json:"goods"`       //商品数组
	TotalPrice float64          `json:"total_price"` //总价格
}

/**
单个商品
 */
type ShoppingGoods struct {
	GoodsId       uint    `json:"goods_id" form:"goods_id"`             //商品id
	GoodsName     string  `json:"goods_name" form:"goods_name"`         //商品名称
	GoodsPicture  string  `json:"goods_picture" form:"goods_picture"`   //商品图片
	GoodsAmount   int32   `json:"goods_amount" form:"goods_amount"`     //商品数量
	GoodsPrice    float32 `json:"goods_price" form:"goods_price"`       //商品单价
	DiscountPrice float64 `json:"discount_price" form:"discount_price"` //折扣价格
}
